/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * JDialogVerCamara.java
 *
 * Created on 22/11/2012, 14:01:05
 */

package hotelinteligente.vista;

import hotelinteligente.Dispositivos;
import hotelinteligente.controladores.Controlador;

/**
 *
 * @author vero
 */
public class JDialogVerCamara extends javax.swing.JDialog {

    /** Creates new form JDialogVerCamara */
    public JDialogVerCamara(java.awt.Frame parent, boolean modal, String id) {
        super(parent, modal);
        initComponents();
        initDatos(id);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanelVigilancia1 = new hotelinteligente.vista.JPanelVigilancia();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("");
        setIconImages(null);

        javax.swing.GroupLayout jPanelVigilancia1Layout = new javax.swing.GroupLayout(jPanelVigilancia1);
        jPanelVigilancia1.setLayout(jPanelVigilancia1Layout);
        jPanelVigilancia1Layout.setHorizontalGroup(
            jPanelVigilancia1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 546, Short.MAX_VALUE)
        );
        jPanelVigilancia1Layout.setVerticalGroup(
            jPanelVigilancia1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 397, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanelVigilancia1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanelVigilancia1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private hotelinteligente.vista.JPanelVigilancia jPanelVigilancia1;
    // End of variables declaration//GEN-END:variables

    private void initDatos(String id) {
        setTitle("Vigilancia " + id);
        if(Controlador.getInstancia().hayIncendioEnCamara(id))
            jPanelVigilancia1.setImagen(Dispositivos.IMAGEN_VIGILANCIA_PASILLO_LLAMAS);
        else
            jPanelVigilancia1.setImagen(Dispositivos.IMAGEN_VIGILANCIA_PASILLO);
        jPanelVigilancia1.revalidate();
        jPanelVigilancia1.repaint();
        jPanelVigilancia1.paintComponent(this.getGraphics());
    }
}
